import types from './types'
import Model from '../../../models/apps'

export default {
  /**
   * 获取列表
   */
  getUserPayInfos ({commit}, {params}) {
    return new Model('userPayInfos').GET({params}).then((res) => {
      commit(types.GET_USERPAYINFOS, {
        data: res.data
      })
    })
  },

  /**
   * 获取详情
   */
  getUserPayInfo ({commit}, {uri}) {
    return new Model('userPayInfo').GET({uri}).then((res) => {
      commit(types.GET_USERPAYINFO, {
        data: res.data
      })
    })
  },

  /**
   * 新增
   */
  postUserPayInfo ({commit}, {data}) {
    return new Model('userPayInfo').POST({data})
  },

  /**
   * 编辑
   */
  putUserPayInfo ({commit}, {uri, data}) {
    return new Model('userPayInfo').PUT({uri, data})
  },

  /**
   * 删除
   */
  deleteUserPayInfo ({commit}, {params}) {
    return new Model('userPayInfo').DELETE({params})
  }
}
